<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="baseurl" value="${pageContext.request.contextPath}/"></c:set>
<%
    request.setCharacterEncoding("UTF-8");
    String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/StudentsListPageAsPxsf.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<%--<%@ include file="/WEB-INF/JSP/backHome/modalWindows/trainChangePrintIncludeFees.jsp" %>--%>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
    select {
        width: 234px;
        height: 31px
    }

    .gn_name {
        padding-top: 5px
    }

    .div_zilei {
        width: 94.5%;
        height: 30px
    }

    .tr {
        height: 40px;
        background: #57a0ff;
        font-weight:700
    }

    .tr td {
        font-size: 14px;
        color: #ffffff;
        font-weight: 700;
    }

    .tr_td {
        height: 40px;
    }

    .tr_td td {
        border-bottom: 1px solid #ededed;
        text-align: center;
    }

    tr td:nth-child(1) {
        font-size: 24px;
        color: #cccccc
    }

    .date {
        border: 0;
        background: #ffffff;
        text-align: center;
    }

    .tr_td td:nth-child(1) {
        border-left: 1px solid #cccccc;
    }

    .tr_td td:nth-child(3) {
        border-right: 1px solid #cccccc;
    }

    .addTable.deleteTable:HOVER {
        cursor: pointer;
    }

    input[type='checkbox'] {
        width: 15px
    }

    #table1 input {
        width: 150px
    }

    #table2 input {
        width: 150px;
    }

    .fseq2 {
        border: none;
        color: #cccccc;
        text-align: center;
    }

    .trainChargeTable tbody tr td { height: 40px;}
    .div_input_hang {
        width: 100%;
        height: 40px;
    }
    .input_hang {
        float: left;
        width: 500px;
        height: 40px;
    }
</style>
<body style="background: #f5f5f5">
<div class="main">
    <div id="modal-overlay">

    </div>
    <c:if test="${empty trainCharge}">
        <div class="weizhi">
            财务管理>>培训收费>>新增
        </div>
    </c:if>
    <c:if test="${not empty trainCharge}">
        <c:if test="${sh == '5'}">
            <div class="weizhi">
                财务管理>>培训收费>>查看
            </div>
        </c:if>
    </c:if>
    <c:if test="${not empty trainCharge}">
        <c:if test="${empty sh}">
            <div class="weizhi">
                财务管理>>培训收费>>修改
            </div>
        </c:if>
    </c:if>
    <div class="div_body" style="box-shadow: 0 0 5px #cccccc;height: 950px">


        <%-------------------------------------打印--------------------------------%>
        <div id="edit-print-id-1" style="display: none" >
            <%-- 不含規費--%>
            <c:forEach items="${trainChargeEntries}" var="trainChargeEntries">
                <div class="modal-data-trainChargePrint" style="margin:0 auto;width: 1000px;
			height: 450px;z-index: 1001;min-height: 300px;margin-top: 1%;background-color: #FFFFFF;
			padding-left: 5px;text-align: center;font-size: 24px">
                    <p>
                        <span style="font-size: 28px;">${department.fnameL2}</span>
                    <div>
                        <table class="trainChargeTable" style="width: 95%;margin-right: auto;margin-left: auto;
				border-collapse:collapse;" cellspacing="0">
                            <tr>
                                <td></td>
                                <td></td>
                                <td style="text-align: right">No:</td>
                                <td style="text-align: left">${trainChargeEntries.cfstudentno}</td>
                            </tr>
                            <tr>
                                <td>收费日期:</td>
                                <td style="text-align: left">${trainCharge.fbizdate}</td>
                                <td>单号:</td>
                                <td style="text-align: left">${trainCharge.fnumber}</td>
                            </tr>
                            <tr>
                                <td style="border: 1px solid" width="15%">学员姓名:</td>
                                <td style="border: 1px solid" width="25%">${trainChargeEntries.studentName}</td>
                                <td width="15%" style="    border: 1px solid">培训类型:</td>
                                <td style="border: 1px solid">${trainChargeEntries.cfclazz}</td>
                            </tr>
                            <tr>
                                <td style="border: 1px solid">收费方式:</td>
                                <td style="border: 1px solid">现金</td>
                                <td style="border: 1px solid">收培训费:</td>
                                <td style="border: 1px solid">${trainChargeEntries.cfcash}</td>
                            </tr>
                            <tr>
                                <td style="border: 1px solid">收费方式</td>
                                <td style="border: 1px solid">刷卡</td>
                                <td style="border: 1px solid">收培训费:</td>
                                <td style="border: 1px solid">${trainChargeEntries.cfcard}</td>
                            </tr>
                            <tr>
                                <td style="border: 1px solid">实收合计:</td>
                                <td style="border: 1px solid">${trainChargeEntries.cfshje}</td>
                                <td style="border: 1px solid">大写:</td>
                                <td style="border: 1px solid" class="turnCapital"></td>
                            </tr>
                        </table>
                    </div>
                    <div style="margin-top: 10px;">
                        <span style="font-size: 24px; margin-left: 2%">收款人:</span>
                        <span style="margin-left: 6%">${trainCharge.createName}</span>
                        <span style="font-size: 24px;margin-left: 6%">收款单位:</span>
                        <span style="margin-left: 3%">${department.fnameL2}</span>
                    </div>
                </div>
            </c:forEach>
        </div>
        <div id="edit-print-id-2" style="display: none;position: relative;top:-25px">

            <%-- 含規費--%>
            <c:forEach items="${trainChargeEntries}" var="trainChargeEntries">
                <div class="modal-data-trainChargePrint" style="margin:0 auto;width: 1000px;
			height: 450px;z-index: 1001;min-height: 300px;margin-top: 1%;background-color: #FFFFFF;
			padding-left: 5px;text-align: center;font-size: 24px">
                    <p>
                        <c:if test="${trainChargeEntries.cfguifei>0}">
                        <span style="font-size: 28px;" >${department.fnameL2}</span>
                    <div>
                        <table class="trainChargeTable" style="width: 95%;margin-right: auto;margin-left: auto;
                border-collapse:collapse;" cellspacing="0">
                            <tr>
                                <td></td>
                                <td></td>
                                <td style="text-align: right">No:</td>
                                <td style="text-align: left">${trainChargeEntries.cfstudentno}</td>
                            </tr>
                            <tr>
                                <td>收费日期:</td>
                                <td style="text-align: left">
                                        ${trainCharge.fbizdate}
                                <td>单号:</td>
                                <td style="text-align: left">${trainCharge.fnumber}</td>
                            </tr>
                            <tr>
                                <td style="border: 1px solid" width="15%">学员姓名:</td>
                                <td style="border: 1px solid" width="25%">${trainChargeEntries.studentName}</td>
                                <td width="15%" style="border: 1px solid">交费方式:</td>
                                <td style="border: 1px solid">
                                    <c:choose>
                                        <c:when test="${trainChargeEntries.cfcash>0&&(trainChargeEntries.cfcash>trainChargeEntries.cfcard)||trainChargeEntries.cfcard==null}">
                                            现金
                                        </c:when>
                                        <c:when test="${trainChargeEntries.cfcard>0&&(trainChargeEntries.cfcard>trainChargeEntries.cfcash)||trainChargeEntries.cfcash==null}">
                                            刷卡
                                        </c:when>
                                        <c:otherwise></c:otherwise>
                                    </c:choose>
                                </td>
                            </tr>
                            <tr>
                                <td style="border: 1px solid">收培训费:</td>
                                <td style="border: 1px solid">0.00</td>
                                <td style="border: 1px solid">培训类型:</td>
                                <td style="border: 1px solid">${trainChargeEntries.cfclazz}</td>
                            </tr>
                            <tr>
                                <td style="border: 1px solid">代收规费:</td>
                                <td style="border: 1px solid">${trainChargeEntries.cfguifei}</td>
                                <td style="border: 1px solid" colspan="2"></td>
                            </tr>
                            <tr>
                                <td style="border: 1px solid">实收合计:</td>
                                <td style="border: 1px solid">${trainChargeEntries.cfguifei}</td>
                                <td style="border: 1px solid">大写:</td>
                                <td style="border: 1px solid" class="turnCapital"></td>
                            </tr>
                        </table>
                    </div>
                    <div style="margin-top: 10px; margin-bottom: 20px;">
                        <span style="font-size: 24px; margin-left: 2%">收款人:</span>
                        <span style="margin-left: 6%">${trainCharge.createName}</span>
                        <span style="font-size: 24px;margin-left: 6%">收款单位:</span>
                        <span style="margin-left: 3%">${department.fnameL2}</span>
                    </div>

                    <br><br>
                    </c:if>
                    <p>
                        <span style="font-size: 28px;">${department.fnameL2}</span>
                    <div>
                        <table class="trainChargeTable" style="width: 95%;margin-right: auto;margin-left: auto;
            border-collapse:collapse;" cellspacing="0">
                            <tr>
                                <td></td>
                                <td></td>
                                <td style="text-align: right">No:</td>
                                <td style="text-align: left">${trainChargeEntries.cfstudentno}</td>
                            </tr>
                            <tr>
                                <td>收费日期:</td>
                                <td style="text-align: left">${trainCharge.fbizdate}</td>
                                <td>单号:</td>
                                <td style="text-align: left">${trainCharge.fnumber}</td>
                            </tr>
                            <tr>
                                <td style="border: 1px solid" width="15%">学员姓名:</td>
                                <td style="border: 1px solid" width="25%">${trainChargeEntries.studentName}</td>
                                <td width="15%" style="border: 1px solid">培训类型:</td>
                                <td style="border: 1px solid">${trainChargeEntries.cfclazz}</td>
                            </tr>
                            <%-- 如果现金大于刷卡 则 现金减规费 反之 。。。。。--%>
                            <%--<c:when test="${!empty trainChargeEntries.cfcash or !empty trainChargeEntries.cfcard}">--%>

                            <%--<c:choose>--%>
                                <%--<c:when test="${trainChargeEntries.cfcash >= trainChargeEntries.cfcard}">--%>
                                    <%--<tr>--%>
                                        <%--<td style="border: 1px solid">收费方式:</td>--%>
                                        <%--<td style="border: 1px solid">现金</td>--%>
                                        <%--<td style="border: 1px solid">收培训费:</td>--%>
                                        <%--<td style="border: 1px solid">现金大刷卡${trainChargeEntries.cfcash - trainChargeEntries.cfguifei}</td>--%>
                                    <%--</tr>--%>

                                    <%--<tr>--%>
                                        <%--<td style="border: 1px solid">收费方式</td>--%>
                                        <%--<td style="border: 1px solid">刷卡</td>--%>
                                        <%--<td style="border: 1px solid">收培训费:</td>--%>
                                        <%--<td style="border: 1px solid">${trainChargeEntries.cfcard }</td>--%>
                                    <%--</tr>--%>
                                <%--</c:when>--%>
                                <%--<c:otherwise>--%>
                                    <%--<tr>--%>
                                        <%--<td style="border: 1px solid">收费方式:</td>--%>
                                        <%--<td style="border: 1px solid">现金</td>--%>
                                        <%--<td style="border: 1px solid">收培训费:</td>--%>
                                        <%--<td style="border: 1px solid">${trainChargeEntries.cfcash }</td>--%>
                                    <%--</tr>--%>

                                    <%--<tr>--%>
                                        <%--<td style="border: 1px solid">收费方式</td>--%>
                                        <%--<td style="border: 1px solid">刷卡</td>--%>
                                        <%--<td style="border: 1px solid">收培训费:</td>--%>
                                        <%--<td style="border: 1px solid">刷卡大现金${trainChargeEntries.cfcard - trainChargeEntries.cfguifei}</td>--%>
                                    <%--</tr>--%>
                                <%--</c:otherwise>--%>
                            <%--</c:choose>--%>
                            <%--</c:when>--%>

                                <c:choose>
                                    <c:when test="${trainChargeEntries.cfcash >= trainChargeEntries.cfcard}">
                                    <tr>
                                    <td style="border: 1px solid">收费方式:</td>
                                    <td style="border: 1px solid">现金</td>
                                    <td style="border: 1px solid">收培训费:</td>
                                    <td style="border: 1px solid">${trainChargeEntries.cfcash - trainChargeEntries.cfguifei}</td>
                                    </tr>

                                    <tr>
                                    <td style="border: 1px solid">收费方式</td>
                                    <td style="border: 1px solid">刷卡</td>
                                    <td style="border: 1px solid">收培训费:</td>
                                    <td style="border: 1px solid">${trainChargeEntries.cfcard }</td>
                                    </tr>
                                    </c:when>
                                    <c:otherwise>
                                        <tr>
                                            <td style="border: 1px solid">收费方式:</td>
                                            <td style="border: 1px solid">现金</td>
                                            <td style="border: 1px solid">收培训费:</td>
                                            <td style="border: 1px solid">
                                                <c:if test="${empty trainChargeEntries.cfcash}">
                                                    ${trainChargeEntries.cfcash }
                                                </c:if>
                                                <c:if test="${!empty trainChargeEntries.cfcash}">
                                                    ${trainChargeEntries.cfcash - trainChargeEntries.cfguifei}
                                                </c:if>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="border: 1px solid">收费方式</td>
                                            <td style="border: 1px solid">刷卡</td>
                                            <td style="border: 1px solid">收培训费:</td>
                                            <td style="border: 1px solid">
                                            <c:if test="${empty trainChargeEntries.cfcard}">
                                                ${trainChargeEntries.cfcard }
                                            </c:if>
                                            <c:if test="${!empty trainChargeEntries.cfcard}">
                                                ${trainChargeEntries.cfcard - trainChargeEntries.cfguifei}
                                            </c:if>
                                            </td>
                                        </tr>
                                    </c:otherwise>
                                </c:choose>
                            <tr>
                                <td style="border: 1px solid">实收合计:</td>
                                <td style="border: 1px solid">${trainChargeEntries.cfshje - trainChargeEntries.cfguifei}</td>
                                <td style="border: 1px solid">大写:</td>
                                <td style="border: 1px solid" class="turnCapital"></td>
                            </tr>
                        </table>
                    </div>
                    <div style="margin-top: 10px;">
                        <span style="font-size: 24px; margin-left: 2%">收款人:</span>
                        <span style="margin-left: 6%">${trainCharge.createName}</span>
                        <span style="font-size: 24px;margin-left: 6%">收款单位:</span>
                        <span style="margin-left: 3%">${department.fnameL2}</span>
                    </div>
                </div>
            </c:forEach>
        </div>
        <%-------------------------------------打印--------------------------------%>


        <!-- 添加 -->
        <c:if test="${empty trainCharge}">
            <div class="div_form">
                <form action="<%=path%>/DrivingSys/addTrainCharge" class="form" method="post"
                      onsubmit="return verify();">
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                            <input type="text" name="name" value="${department.fnameL2}" readonly unselectable="on"
                                   style="color: gray;"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                            <input type="text" name="fnumber" value="${fnumber}" style="color: gray;" readonly
                                   unselectable="on"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                            <input type="text" name="fbizdate" id="ywrq" value="${date}"
                                   onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
                            <img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
                                 src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">摘要&nbsp;:&nbsp;</span>
                            <input name="fdescription"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                            <select name="cfbillstate" disabled="disabled">
                                <option style="color: gray;">保存</option>
                            </select>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">打印次数&nbsp;:&nbsp;</span>
                            <input name="cfdycs" value="0" style="color: gray;" readonly unselectable="on"/>
                        </div>
                    </div>

                    <div class="div_zilei">
                        <div style="width: 93%;text-align: right;">
                            <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                            <span style="padding-right: 20px;color: #57a0ff;font-weight:700;font-weight: 700;font-size: 14px" class="addTable">添加</span>
                            <img src="<%=path%>/image/delete212.png" class="deleteTable">
                            <span class="deleteTable" style="color: #57a0ff;font-weight:700;font-weight: 700;font-size: 14px" class="deleteTable">删除</span>
                        </div>
                    </div>
                    <input type="hidden" class="stu">
                    <input type="hidden" id="stuId">
                    <div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
                        <div style="overflow:scroll;height: 500px;width: 100%">
                            <table width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
                                <tr class="tr">
                                    <td width="20px"></td>
                                    <td width="30px"></td>
                                    <td align="center">学员编码</td>
                                    <td align="center">学员</td>
                                    <td align="center">性别</td>
                                    <td align="center">身份证号</td>
                                    <td align="center">身份证地址</td>
                                    <td align="center">推荐人</td>
                                    <td align="center">班级</td>
                                    <td align="center">班级金额</td>
                                    <td align="center">已收</td>
                                    <td align="center">应收金额</td>
                                    <td align="center">规费</td>
                                    <td align="center">培训费</td>
                                    <td align="center">现金</td>
                                    <td align="center">刷卡</td>
                                    <td align="center">挂账</td>
                                    <td align="center">银行转账</td>
                                    <td align="center">实收金额</td>
                                    <td align="center">优惠金额</td>
                                    <td align="center">优惠券</td>
                                    <td align="center">欠费金额</td>
                                    <td align="center">摘要</td>
                                </tr>
                            </table>

                            <table align="center" id="table2"
                                   style="height:50px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;">
                                <tr>
                                    <td><input type="text" readonly unselectable="on" value="合计" class="fseq2"
                                               style="width: 55px;"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" value="0" readonly unselectable="on" class="gf"><input
                                            type="hidden" value="0"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" value="0" readonly unselectable="on" id="cfcash"></td>
                                    <td><input type="text" value="0" readonly unselectable="on" id="cfcard"></td>
                                    <td><input type="text" value="0" readonly unselectable="on" id="cfguazhang"></td>
                                    <td><input type="text" value="0" readonly unselectable="on" id="cfyhzz"></td>
                                    <td><input type="text" value="0" readonly unselectable="on" id="cfshje"></td>
                                    <td><input type="text" value="0" readonly unselectable="on" id="cfyhje"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                    <td><input type="text" value="0" readonly unselectable="on" id="cfqfje"><input
                                            type="hidden" value="0"></td>
                                    <td><input type="text" readonly unselectable="on"></td>
                                </tr>
                            </table>
                        </div>
                    </div>


                    <div class="div_input_hang" style="margin-top: 50px">
                        <div class="input_hang">
                            <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                            <input name="fhandlerid" readonly unselectable="on" style="color: gray;" type="text"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">创建者&nbsp;:&nbsp;</span>
                            <input name="fcreatorid2" readonly unselectable="on" value="${name}" style="color: gray;"
                                   type="text"/>
                            <input name="fcreatorid" readonly unselectable="on" style="color: gray;" type="hidden"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                            <input name="fcreatetime" style="color: gray;" readonly unselectable="on" type="text"/>
                        </div>
                    </div>

                    <div class="div_tj" style="padding-top: 0px;margin-left: 140px;margin-top: 20px;">
                        <div>
                            <input class="input_submit bc" value="" type="submit" style="margin-top: 0px;margin-right: 30px;"/>
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value="" onclick="back()" style="margin-top: 0px;"/>
                        </div>
                    </div>
                </form>
            </div>
        </c:if>

        <!-- 修改 -->
        <c:if test="${not empty trainCharge}">
            <c:if test="${empty sh}">
                <div class="div_form">
                    <form action="<%=path%>/DrivingSys/modifyTrainCharge" class="form" method="post"
                          onsubmit="return verify();">
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                                <input type="text" name="name" value="${department.fnameL2}" readonly unselectable="on"
                                       style="color: gray;"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                                <input type="text" name="fnumber" value="${trainCharge.fnumber}" style="color: gray;"
                                       readonly unselectable="on"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                                <input type="text" name="fbizdate" id="ywrq" value="${trainCharge.fbizdate}"
                                       onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
                                <img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
                                     src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">摘要&nbsp;:&nbsp;</span>
                                <input name="fdescription" value="${trainCharge.fdescription}"/>
                                <input type="hidden" name="fid" value="${trainCharge.fid}" class="fid"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                                <select name="cfbillstate" disabled="disabled">
                                    <option style="color: gray;">保存</option>
                                </select>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">打印次数&nbsp;:&nbsp;</span>
                                <input name="cfdycs" value="${trainCharge.cfdycs}" style="color: gray;" readonly
                                       unselectable="on"/>
                            </div>
                        </div>

                        <div style="margin-left: 60%" class="div_zilei">

                                    <%--<img src="<%=path%>/image/insert2323.jpg">
                                    <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px">添加</span>
                                    <img src="<%=path%>/image/delete212.png">
                                    <span class="deleteTable" style="color: #a9bbe0;font-size: 14px">删除</span>--%>
                                <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                                <span style="padding-right: 20px;color: #337ab7;font-weight: 700;font-size: 14px" class="addTable">添加</span>
                                <img src="<%=path%>/image/delete212.png" class="deleteTable">
                                <span class="deleteTable" style="color: #57a0ff;font-weight:700;font-weight: 700;font-size: 14px"
                                      class="deleteTable">删除</span>
                                        <select style="width: 150px" id="printState">
                                            <option value="0">包含規費</option>
                                            <option value="1">不含規費</option>
                                        </select>
                                        <span style="cursor:pointer; padding-left: 40px;color: #337ab7;font-weight: 700;font-size: 14px"
                                              class="printTable" onclick="test()">打印</span>

                        </div>
                        <input type="hidden" class="stu">
                        <input type="hidden" id="stuId">
                        <input type="hidden" id="auditState" value="${AuditState}">
                        <div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
                            <div style="overflow:scroll;height: 500px;width: 100%">
                                <table width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
                                    <tr class="tr">
                                        <td width="20px"></td>
                                        <td width="30px"></td>
                                        <td align="center">学员编码</td>
                                        <td align="center">学员</td>
                                        <td align="center">性别</td>
                                        <td align="center">身份证号</td>
                                        <td align="center">身份证地址</td>
                                        <td align="center">推荐人</td>
                                        <td align="center">班级</td>
                                        <td align="center">班级金额</td>
                                        <td align="center">已收</td>
                                        <td align="center">应收金额</td>
                                        <td align="center">规费</td>
                                        <td align="center">培训费</td>
                                        <td align="center">现金</td>
                                        <td align="center">刷卡</td>
                                        <td align="center">挂账</td>
                                        <td align="center">银行转账</td>
                                        <td align="center">实收金额</td>
                                        <td align="center">优惠金额</td>
                                        <td align="center">优惠券</td>
                                        <td align="center">欠费金额</td>
                                        <td align="center">摘要</td>
                                    </tr>
                                    <c:forEach items="${trainChargeEntries}" var="trainChargeEntries">
                                        <tr style="margin-top: 45px" id="xy${trainChargeEntries.fseq}">
                                            <td width="20px"><input type="checkbox" name="check" style="width: 15px"></td>
                                            <td>
                                                <input type="text" readonly unselectable="on" class="fseq2"
                                                       value="${trainChargeEntries.fseq}" style="width: 40px">
                                                <input type="hidden" name="fseq" class="fseq"
                                                       value="${trainChargeEntries.fseq}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfstudentno}" readonly
                                                       unselectable="on" class="cfstudentno" name="cfstudentno"/>
                                                <input type="hidden" name="cfstudentid"
                                                       value="${trainChargeEntries.cfstudentid}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.studentName}"
                                                       name="studentName" class="studentName is_click_ne"
                                                       onclick="selSrtdent($(this))"/>
                                                <input type="hidden" name="" value="${trainChargeEntries.cfstudentid}">
                                            </td>
                                            <td>
                                                <c:if test="${trainChargeEntries.cfsex == '1'}">
                                                    <input type="text" readonly unselectable="on" value="男" name="cfsex2"
                                                           class="cfsex"/>
                                                    <input type="hidden" value="1" name="cfsex"/>
                                                </c:if>
                                                <c:if test="${trainChargeEntries.cfsex == '2'}">
                                                    <input type="text" readonly unselectable="on" value="女" name="cfsex2"
                                                           class="cfsex"/>
                                                    <input type="hidden" value="2" name="cfsex"/>
                                                </c:if>
                                                <c:if test="${empty trainChargeEntries.cfsex}">
                                                    <input type="text" readonly unselectable="on" value="女" name="cfsex2"
                                                           class="cfsex"/>
                                                    <input type="hidden" value="2" name="cfsex"/>
                                                </c:if>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfidcardno}" name="cfidcardno"
                                                       class="cfidcardno"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfidcardaddress}" name="cfidcardaddress"
                                                       class="cfidcardaddress"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cftjr}" name="cftjr" class="cftjr"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfclazz}" name="cfclazz"
                                                       class="cfclazz"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfclazzamount}" name="cfclazzamount"
                                                       class="cfclazzamount"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfyishou}" name="cfyishou"
                                                       class="cfyishou"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfysje}" name="cfysje" class="cfysje"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfguifei}" name="cfguifei"
                                                       class="cfguifei"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfpxf}" name="cfpxf" class="cfpxf"/>
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfcash}" name="cfcash"
                                                       class="cfcash" onblur="cfcash2($(this))"/>
                                                <input type="hidden" value="${trainChargeEntries.cfcash}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfcard}" name="cfcard"
                                                       class="cfcard" onblur="cfcard2($(this))"/>
                                                <input type="hidden" value="${trainChargeEntries.cfcard}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfguazhang}"
                                                       name="cfguazhang" class="cfguazhang" onblur="cfguazhang2($(this))"/>
                                                <input type="hidden" value="${trainChargeEntries.cfguazhang}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfyhzz}" name="cfyhzz"
                                                       class="cfyhzz" onblur="cfyhzz2($(this))"/>
                                                <input type="hidden" value="${trainChargeEntries.cfyhzz}">
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfshje}" name="cfshje" class="cfshje"/>
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfyhje}" name="cfyhje"
                                                       class="cfyhje" onblur="cfyhje2($(this))"/>
                                                <input type="hidden" value="${trainChargeEntries.cfyhje}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfyhj}" name="cfyhj"
                                                       class="cfyhj" onblur="cfyhj2($(this))"/>
                                                <input type="hidden" value="${trainChargeEntries.cfyhj}">
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfqfje}" name="cfqfje" class="cfqfje"/>
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfremark}" name="cfremark"
                                                       class="cfremark"/>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                </table>

                                <table align="center" id="table2"
                                       style="height:50px;overflow:scroll;border-spacing:0;margin-top: 100px;">
                                    <tr>
                                        <td><input type="text" readonly unselectable="on" value="合计" class="fseq"
                                                   style="width: 55px"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" class="gf"><input
                                                type="hidden" value="0"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfcash"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfcard"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfguazhang"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfyhzz"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfshje"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfyhje"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfqfje"><input
                                                type="hidden" value="0"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                    </tr>
                                </table>
                            </div>
                        </div>


                        <div class="div_input_hang" style="margin-top: 50px;">
                            <div class="input_hang">
                                <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                                <input name="fhandlerid" readonly unselectable="on" style="color: gray;" type="text"
                                       value="${trainCharge.shName}"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">创建者&nbsp;:&nbsp;</span>
                                <input name="fcreatorid2" readonly unselectable="on" value="${trainCharge.createName}"
                                       style="color: gray;" type="text"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                                <input name="fcreatetime" style="color: gray;" readonly unselectable="on" type="text"
                                       value="${trainCharge.fcreatetime}"/>
                            </div>
                        </div>

                        <div class="div_tj" style="padding-top: 0px;width:80%">
                            <shiro:hasPermission name="/selectTrainChargeByFid">
                                <div>
                                    <input class="input_submit bc" value="" type="submit">
                                </div>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="/submitTrainCharge">
                                <%--<div style="padding-right: 50px">
                                    <input type="button" class="input_submit tj" value="" id="submit"/>
                                </div>--%>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="/auditTrainCharge">
                               <%-- <div style="padding-right: 50px">
                                    <input type="button" class="input_submit sh" value="" id="submit_audit"/>
                                    <input type="hidden" value="1">
                                </div>--%>
                            </shiro:hasPermission>
                            <div>
                                <input type="button" class="input_back fh" value="" onclick="back()"/>
                            </div>
                        </div>
                    </form>
                </div>
            </c:if>
        </c:if>

        <!-- 查看 -->
        <c:if test="${not empty trainCharge}">
            <c:if test="${sh == '5'}">
                <div class="div_form">
                    <form action="<%=path%>/DrivingSys/modifyTrainCharge" class="form">
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                                <input type="text" name="name" value="${department.fnameL2}" readonly unselectable="on"
                                       style="color: gray;"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                                <input type="text" name="fnumber" id="fnumber" value="${trainCharge.fnumber}"
                                       style="color: gray;" readonly unselectable="on"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                                <input type="text" name="fbizdate" id="ywrq" value="${trainCharge.fbizdate}" readonly
                                       unselectable="on"/>
                                <img src="<%=path%>/image/date.jpg" style="padding-left: 15px">
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">摘要&nbsp;:&nbsp;</span>
                                <input name="fdescription" value="${trainCharge.fdescription}" readonly unselectable="on"/>
                                <input type="hidden" name="fid" value="${trainCharge.fid}" class="fid"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                                <select name="cfbillstate" disabled="disabled">
                                    <c:if test="${trainCharge.cfbillstate == '4'}">
                                        <option style="color: gray;">提交</option>
                                    </c:if>
                                    <c:if test="${trainCharge.cfbillstate == '5'}">
                                        <option style="color: gray;">审核</option>
                                    </c:if>

                                </select>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">打印次数&nbsp;:&nbsp;</span>
                                <input name="cfdycs" value="${trainCharge.cfdycs}" style="color: gray;" readonly
                                       unselectable="on"/>
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div style="margin-left: 74%" class="div_input_hang">
                                <select style="width: 150px" id="printState">
                                    <option value="0">包含規費</option>
                                    <option value="1">不含規費</option>
                                </select>
                                <span style="cursor:pointer; padding-left: 40px;color: #337ab7;font-weight: 700;font-size: 14px"
                                      class="printTable" onclick="test()">打印</span>
                                    <%--<img src="<%=path%>/image/insert2323.jpg">
                                    <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px">添加</span>
                                    <img src="<%=path%>/image/delete212.png">
                                    <span class="deleteTable" style="color: #a9bbe0;font-size: 14px">删除</span>--%>
                            </div>
                        </div>
                        <input type="hidden" class="stu">
                        <input type="hidden" id="type">
                        <input type="hidden" id="state" value="${trainCharge.cfbillstate}">
                        <div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
                            <div style="overflow:scroll;height: 500px;width: 100%">
                                <table width="100%" align="center" id="table2" style="min-height:50px;border-spacing:0;">
                                    <tr class="tr">
                                        <td width="20px"></td>
                                        <td width="30px"></td>
                                        <td align="center">学员编码</td>
                                        <td align="center">学员</td>
                                        <td align="center">性别</td>
                                        <td align="center">身份证号</td>
                                        <td align="center">身份证地址</td>
                                        <td align="center">推荐人</td>
                                        <td align="center">班级</td>
                                        <td align="center">班级金额</td>
                                        <td align="center">已收</td>
                                        <td align="center">应收金额</td>
                                        <td align="center">规费</td>
                                        <td align="center">培训费</td>
                                        <td align="center">现金</td>
                                        <td align="center">刷卡</td>
                                        <td align="center">挂账</td>
                                        <td align="center">银行转账</td>
                                        <td align="center">实收金额</td>
                                        <td align="center">优惠金额</td>
                                        <td align="center">优惠券</td>
                                        <td align="center">欠费金额</td>
                                        <td align="center">摘要</td>
                                    </tr>
                                    <c:forEach items="${trainChargeEntries}" var="trainChargeEntries">
                                        <tr style="margin-top: 45px" id="xy${trainChargeEntries.fseq}">
                                            <td width="20px"><input type="checkbox" name="check" style="width: 15px"
                                                                    disabled="disabled"></td>
                                            <td>
                                                <input type="text" readonly unselectable="on" class="fseq2"
                                                       value="${trainChargeEntries.fseq}" style="width: 40px">
                                                <input type="hidden" name="fseq" class="fseq"
                                                       value="${trainChargeEntries.fseq}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfstudentno}" readonly
                                                       unselectable="on" class="cfstudentno" name="cfstudentno"/>
                                                <input type="hidden" name="cfstudentid"
                                                       value="${trainChargeEntries.cfstudentid}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.studentName}"
                                                       name="studentName" class="studentName" readonly unselectable="on"/>
                                                <input type="hidden" name="" value="${trainChargeEntries.cfstudentid}">
                                            </td>
                                            <td>
                                                <c:if test="${trainChargeEntries.cfsex == '1'}">
                                                    <input type="text" readonly unselectable="on" value="男" name="cfsex2"
                                                           class="cfsex"/>
                                                    <input type="hidden" value="1" name="cfsex"/>
                                                </c:if>
                                                <c:if test="${trainChargeEntries.cfsex == '2'}">
                                                    <input type="text" readonly unselectable="on" value="女" name="cfsex2"
                                                           class="cfsex"/>
                                                    <input type="hidden" value="2" name="cfsex"/>
                                                </c:if>
                                                <c:if test="${empty trainChargeEntries.cfsex}">
                                                    <input type="text" readonly unselectable="on" value="女" name="cfsex2"
                                                           class="cfsex"/>
                                                    <input type="hidden" value="2" name="cfsex"/>
                                                </c:if>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfidcardno}" name="cfidcardno"
                                                       class="cfidcardno"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfidcardaddress}" name="cfidcardaddress"
                                                       class="cfidcardaddress"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cftjr}" name="cftjr" class="cftjr"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfclazz}" name="cfclazz"
                                                       class="cfclazz"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfclazzamount}" name="cfclazzamount"
                                                       class="cfclazzamount"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfyishou}" name="cfyishou"
                                                       class="cfyishou"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfysje}" name="cfysje" class="cfysje"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfguifei}" name="cfguifei"
                                                       class="cfguifei"/>
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfpxf}" name="cfpxf" class="cfpxf"/>
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfcash}" name="cfcash"
                                                       class="cfcash" readonly unselectable="on"/>
                                                <input type="hidden" value="${trainChargeEntries.cfcash}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfcard}" name="cfcard"
                                                       class="cfcard" readonly unselectable="on"/>
                                                <input type="hidden" value="${trainChargeEntries.cfcard}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfguazhang}"
                                                       name="cfguazhang" class="cfguazhang" readonly unselectable="on"/>
                                                <input type="hidden" value="${trainChargeEntries.cfguazhang}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfyhzz}" name="cfyhzz"
                                                       class="cfyhzz" readonly unselectable="on"/>
                                                <input type="hidden" value="${trainChargeEntries.cfyhzz}">
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfshje}" name="cfshje" class="cfshje"/>
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfyhje}" name="cfyhje"
                                                       class="cfyhje" readonly unselectable="on"/>
                                                <input type="hidden" value="${trainChargeEntries.cfyhje}">
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfyhj}" name="cfyhj"
                                                       class="cfyhj" readonly unselectable="on"/>
                                                <input type="hidden" value="${trainChargeEntries.cfyhj}">
                                            </td>
                                            <td>
                                                <input type="text" readonly unselectable="on"
                                                       value="${trainChargeEntries.cfqfje}" name="cfqfje" class="cfqfje"/>
                                            </td>
                                            <td>
                                                <input type="text" value="${trainChargeEntries.cfremark}" name="cfremark"
                                                       class="cfremark" readonly unselectable="on"/>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                </table>

                                <table align="center" id="table2"
                                       style="height:50px;overflow:scroll;border-spacing:0;margin-top: 100px;">
                                    <tr>
                                        <td><input type="text" readonly unselectable="on" value="合计" class="fseq"
                                                   style="width: 55px"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" class="gf"><input
                                                type="hidden" value="0"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfcash"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfcard"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfguazhang"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfyhzz"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfshje"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfyhje"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                        <td><input type="text" value="0" readonly unselectable="on" id="cfqfje"><input
                                                type="hidden" value="0"></td>
                                        <td><input type="text" readonly unselectable="on"></td>
                                    </tr>
                                </table>
                            </div>
                        </div>


                        <div class="div_input_hang" style="margin-top: 50px">
                            <div class="input_hang">
                                <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                                <input name="fhandlerid" readonly unselectable="on" style="color: gray;" type="text"
                                       value="${trainCharge.shName}"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">创建者&nbsp;:&nbsp;</span>
                                <input name="fcreatorid" readonly unselectable="on" value="${trainCharge.createName}"
                                       style="color: gray;" type="text"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                                <input name="fcreatetime" style="color: gray;" readonly unselectable="on" type="text"
                                       value="${trainCharge.fcreatetime}"/>
                            </div>
                        </div>

                        <div class="div_tj" style="padding-top: 0px;width:80%">
                            <c:if test="${AuditState == 'true'}">
                                <shiro:hasPermission name="/auditTrainCharge">
                                    <div style="padding-right: 50px">
                                        <input type="button" class="input_submit sh" value="" id="sh"/>
                                        <input type="hidden" value="1">
                                    </div>
                                </shiro:hasPermission>
                            </c:if>
                            <shiro:hasPermission name="/againstAuditTrainCharge">
                                <div style="padding-right: 50px">
                                    <input type="button" class="input_submit fsh" value="" id="fsh">
                                    <input type="hidden" value="2">
                                </div>
                            </shiro:hasPermission>
                            <div>
                                <%--<input type="button" class="input_submit cklc" value=""
                                       onclick="lookActivitiImg('${key}',$('#fnumber').val())"/>--%>
                            </div>
                            <div>
                                <input type="button" class="input_back fh" value="" onclick="back()"/>
                            </div>
                        </div>
                    </form>
                </div>
            </c:if>
        </c:if>
    </div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/common/print/jQuery.print.min.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">

    $(document).ready(function () {
        var type = "${type}"
        if (type == null || type == '') {

        } else {
            editAlert();
        }
    })


    //删除一行
    $(".deleteTable").click(function () {
        var tr_len = $("#table1 tr").length;
        if (tr_len == 1) {

        } else {
            var s = '';
            $('input:checkbox[name=check]').each(function (i) {
                if ($(this).is(':checked')) {
                    //减去规费
                    var guifei = $(this).parent().parent().find(".cfguifei").val()
                    var card = ($(".gf").val() * 1) - (guifei * 1)
                    //保留2位小数点
                    card = decimal(card, 2);
                    $(".gf").val(card)
                    $(".gf").next().val(card)

                    //减去现金
                    var cfcash = $(this).parent().parent().find(".cfcash").val()
                    if (cfcash == '' || cfcash == null) {

                    } else {
                        var cash = ($("#cfcash").val() * 1) - (cfcash * 1)
                        //保留2位小数点
                        cash = decimal(cash, 2);
                        $("#cfcash").val(cash)
                    }
                    //减去刷卡
                    var cfcard = $(this).parent().parent().find(".cfcard").val()
                    if (cfcard == '' || cfcard == null) {

                    } else {
                        var card = ($("#cfcard").val() * 1) - (cfcard * 1)
                        //保留2位小数点
                        card = decimal(card, 2);
                        $("#cfcard").val(card)
                    }
                    //减去挂账
                    var cfguazhang = $(this).parent().parent().find(".cfguazhang").val()
                    if (cfguazhang == '' || cfguazhang == null) {

                    } else {
                        var cfguazhang2 = ($("#cfguazhang").val() * 1) - (cfguazhang * 1)
                        //保留2位小数点
                        cfguazhang2 = decimal(cfguazhang2, 2);
                        $("#cfguazhang").val(cfguazhang2)
                    }
                    //减去银行转账
                    var cfyhzz = $(this).parent().parent().find(".cfyhzz").val()
                    if (cfyhzz == '' || cfyhzz == null) {

                    } else {
                        var cfyhzz2 = ($("#cfyhzz").val() * 1) - (cfyhzz * 1);
                        //保留2位小数点
                        cfyhzz2 = decimal(cfyhzz2, 2);
                        $("#cfyhzz").val(cfyhzz2)
                    }
                    //减去实收金额
                    var cfshje = $(this).parent().parent().find(".cfshje").val()
                    if (cfshje == '' || cfshje == null) {

                    } else {
                        var cfshje2 = ($("#cfshje").val() * 1) - (cfshje * 1);
                        //保留2位小数点
                        cfshje2 = decimal(cfshje2, 2);
                        $("#cfshje").val(cfshje2)
                    }
                    //减去优惠金额
                    var cfyhje = $(this).parent().parent().find(".cfyhje").val()
                    if (cfyhje == '' || cfyhje == null) {

                    } else {
                        var cfyhje2 = ($("#cfyhje").val() * 1) - (cfyhje * 1)
                        //保留2位小数点
                        cfyhje2 = decimal(cfyhje2, 2);
                        $("#cfyhje").val(cfyhje2)
                    }
                    //减去欠费金额
                    var cfqfje = $(this).parent().parent().find(".cfqfje").val()
                    if (cfqfje == '' || cfqfje == null) {

                    } else {
                        var cfqfje2 = ($("#cfqfje").val() * 1) - (cfqfje * 1)
                        //保留2位小数点
                        cfqfje2 = decimal(cfqfje2, 2);
                        $("#cfqfje").val(cfqfje2)
                        $("#cfqfje").next().val(cfqfje2)
                    }
                    $(this).parent().parent().remove();
                    s = '1';
                }
            })

            if ($("#table1 tr").length == 1) {
                $("#table2").css('display', 'none')
            }
            //判断是否选中
            if (s == null || s == '') {
                alert("请选择一条数据删除");
                return false;
            }
            //重新排序
            $('#table1 tr td .fseq').each(function (i) {
                var s = i * 1 + 1 * 1;
                $(this).val(s);
                $(this).prev().val(s)
                $(this).parent().parent().attr("id", 'xy' + s);
            })
        }
    })

    //返回
    function back() {
        parent.closeSelectCard()

//        location = '<%=path%>/DrivingSys/queryTrainCharge/look.action';
    }

    //开启弹框
    $('.addTable').click(function () {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data').css('visibility', 'visible')
        $('.xysj input:checkbox').removeAttr('checked');
        $('#index').val(0)
        $('.page').show();
    })

    //开启打印弹窗
    $('.printTable').click(function () {
        $('.modal-data-trainChargePrint').css('visibility', 'visible')
    })

    $('.closeTablea').click(function () {
        $('.modal-data-trainChargePrint').css('visibility', 'hidden');
    })


    //由于和input:checkbox冲突，在选择一次
    $("#table1 tr td input:checkbox").live('click', function () {
        if ($(this).is(':checked')) {
            $(this).removeAttr("checked");
        } else {
            $(this).attr("checked", ":checked")
        }
    })
    //单击选中
    $("#table1 tr td").live('click', function () {
        if ($(this).parent().find("input:checkbox").is(':checked')) {
            $(this).parent().find("input:checkbox").removeAttr("checked");
        } else {
            $(this).parent().find("input:checkbox").attr("checked", ":checked")
        }
    })

    $("#table1 input").live('keyup', function (event) {
        var cfremark = $(this).prop("class");
        if (cfremark == 'cfremark') {

        } else {
            //最后一位是小数点的话，移除
            var $amountInput = $(this);
            //响应鼠标事件，允许左右方向键移动
            event = window.event || event;
            if (event.keyCode == 37 | event.keyCode == 39) {
                return;
            }
            var clazz = $(this).prop("class")
            //获取父类class名称
            var superclass = $(this).parent().parent().prop("class")
            //获取输入框的值
            var value = $('.' + clazz + '').val();
            //判断负数是否在第一位
            if (value.substring(0, 1) == '-') {

            }
            //判断负数不是在第一位，替换
            if (value.lastIndexOf('-') > 0) {
                $('#superclass .' + clazz + '').val("")
                // $amountInput.val($amountInput.val().replace('-','')
            }
            //先把非数字的都替换掉，除了数字和.
            $amountInput.val($amountInput.val().replace(/[^\-?\d.]/g, "").//只允许一个小数点
            replace(/^\./g, "").replace(/\.{2,}/g, ".").//只能输入小数点后两位
            replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
        }
    });

    /* 关闭弹出框    */
    $('.btn').click(function () {
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data').css('visibility', 'hidden')
        $('.page').hide();
        $(".stu").val("")
    })

    //选择数据
    $('.subtn').click(function () {
        var fseq = $(".stu").val()
        var spCodesTemp = "";
        if (fseq == '' || fseq == null) {
            $('input:checkbox[name=student]:checked').each(function (i) {
                if (0 == i) {
                    //把学生id增加到字表中
                    spCodesTemp = $(this).val();

                } else {
                    spCodesTemp += ("," + $(this).val());

                }
            });

            if (spCodesTemp == "") {
                alert("请至少选择一条数据")
                return false
            }
            //判断重复学员
            var a = studentRepetition(null, spCodesTemp)
            if (!a) {
                alert("不能添加重复学员");
                return;
            }
            $.ajax({
                url: '<%=path%>/DrivingSys/selStudentByFid',
                type: "post",
                async: true,
                data: {'id': spCodesTemp},
                dataType: "json",
                success: function (json) {
                    data(json.studentsNameList, fseq)
                },
                error: function () {
                    alert("错误")
                }
            })
        } else {
            $('input:checkbox[name=student]:checked').each(function (i) {
                if (0 == i) {
                    //把学生id增加到字表中
                    spCodesTemp = $(this).val();
                } else {

                }
            });
            if (spCodesTemp == $("#stuId").val()) {

            } else {
                //判断重复学员
                var a = studentRepetition(null, spCodesTemp)
                if (!a) {
                    alert("不能添加重复学员");
                    return;
                }
            }
            $.ajax({
                url: '<%=path%>/DrivingSys/selStudentByFid',
                type: "post",
                async: true,
                data: {'id': spCodesTemp},
                dataType: "json",
                success: function (json) {
                    var studentsNameList = json.studentsNameList[0];
                    data(studentsNameList, fseq)
                },
                error: function () {
                    alert("错误")
                }
            })
        }
    });
    //双击确定选中数据
    $(document).on('dblclick', '.xysj td', function () {
        var fseq = $(".stu").val()
        var spCodesTemp = "";
        if (fseq == '' || fseq == null) {
            spCodesTemp = $(this).parent().find(".td").find("input:checkbox").val();
            var a = studentRepetition(spCodesTemp, null)
            if (!a) {
                alert("不能添加重复学员");
                return;
            }
            $.ajax({
                url: '<%=path%>/DrivingSys/selStudentByFid',
                type: "post",
                async: true,
                data: {'id': spCodesTemp},
                dataType: "json",
                success: function (json) {
                    data(json.studentsNameList, fseq)
                },
                error: function () {
                    alert("错误")
                }
            })
        } else {
            spCodesTemp = $(this).parent().find(".td").find("input:checkbox").val();
            if (spCodesTemp == $("#stuId").val()) {

            } else {
                var a = studentRepetition(spCodesTemp, null)
                if (!a) {
                    alert("不能添加重复学员");
                    return;
                }
            }
            $.ajax({
                url: '<%=path%>/DrivingSys/selStudentByFid',
                type: "post",
                async: true,
                data: {'id': spCodesTemp},
                dataType: "json",
                success: function (json) {
                    var studentsNameList = json.studentsNameList[0];
                    data(studentsNameList, fseq)
                },
                error: function () {
                    alert("错误")
                }
            })
        }
    })

    //去除重复学员数据
    function studentRepetition(oneStudent, muchStudent) {
        var a = true;
        if (oneStudent == null) {
            var strs = new Array(); //定义一数组
            strs = muchStudent.split(",");//转换成数组
            //循环添加的学员
            for (var i = 0; i < strs.length; i++) {
                //循环现有的学员
                $("input[name='cfstudentid']").each(function (j) {
                    //判断添加的学员不能与现有的学员重复
                    if (strs[i] == $(this).val()) {
                        a = false
                    }
                })
            }
        } else {
            //循环现有的学员
            $("input[name='cfstudentid']").each(function (j) {
                //判断添加的学员不能与现有的学员重复
                if (oneStudent == $(this).val()) {
                    a = false
                }
            })
        }
        return a;
    }


    //写入数据
    function data(studentsNameList, fseq) {
        studentRepetition(fseq);
        //规费
        var jsgf = 0;
        //欠费金额
        var qfjine = 0;
        var tr_len = $("#table1 tr").length;//表格长度
        var str = ''
        if (fseq == null || fseq == '') {
            for (var i = 0; i < studentsNameList.length; i++) {
                str += '<tr style="margin-top: 45px" id=xy' + (tr_len + i) + '>'
                str += '<td width="20px"><input type="checkbox" name="check" style="width: 15px"></td>'
                str += '<td><input type="text" readonly unselectable="on" class="fseq2" value=' + (tr_len + i) + ' style="width: 40px"><input type="hidden" name="fseq" class="fseq" value=' + (tr_len + i) + '></td>'
                //str+='<input type="text" name="fseq" class="fseq" value='+(tr_len+i)+' readonly unselectable="on" style="width:40px"></td>'
                if (studentsNameList[i].fnumber == null) {
                    str += '<td class="zjzdName"><input type="text" readonly unselectable="on" name="cfstudentno" class="cfstudentno"/><input type="hidden" name="cfstudentid" value=' + studentsNameList[i].fid + '></td>'
                } else {
                    str += '<td class="zjzdName"><input type="text" value=' + studentsNameList[i].fnumber + ' readonly unselectable="on" class="cfstudentno" name="cfstudentno" /><input type="hidden" name="cfstudentid" value=' + studentsNameList[i].fid + '></td>'
                }
                if (studentsNameList[i].fnameL2 == null) {
                    str += '<td class="zjzdName"><input type="text" onclick="selSrtdent($(this))" name="studentName" class="studentName is_click_ne"/></td>'
                } else {
                    str += '<td class="zjzdName"><input type="text" value=' + studentsNameList[i].fnameL2 + ' name="studentName" class="studentName is_click_ne" onclick="selSrtdent($(this))"/></td>'
                }
                if (studentsNameList[i].cfsex == '1') {
                    str += '<td><input type="text" readonly unselectable="on" value="男" name="cfsex2" class="cfsex"/><input type="hidden" value="1" name="cfsex"/></td>'
                } else {
                    str += '<td><input type="text" readonly unselectable="on" value="女" name="cfsex2" class="cfsex"/><input type="hidden"value="2" name="cfsex"/></td>'
                }
                if (studentsNameList[i].cfidcardno == null) {
                    str += '<td><input type="text" readonly unselectable="on" name="cfidcardno" class="cfidcardno"/></td>'
                } else {
                    str += '<td><input type="text" readonly unselectable="on" value=' + studentsNameList[i].cfidcardno + ' name="cfidcardno" class="cfidcardno"/></td>'
                }
                if (studentsNameList[i].cflinkaddress == null) {
                    str += '<td><input type="text" readonly unselectable="on" name="cfidcardaddress" class="cfidcardaddress"/></td>'
                } else {
                    str += '<td><input type="text" readonly unselectable="on" value=' + studentsNameList[i].cflinkaddress + ' name="cfidcardaddress" class="cfidcardaddress"/></td>'
                }
                if (studentsNameList[i].cftjrName == null) {
                    str += '<td><input type="text" readonly unselectable="on" name="cftjr" class="cftjr" /></td>'
                } else {
                    str += '<td><input type="text" readonly unselectable="on" value=' + studentsNameList[i].cftjrName + ' name="cftjr" class="cftjr"/></td>'
                }
                if (studentsNameList[i].cfclazzName == null) {
                    str += '<td><input type="text" readonly unselectable="on" name="cfclazz" class="cfclazz"/></td>'
                } else {
                    str += '<td><input type="text" readonly unselectable="on" value=' + studentsNameList[i].cfclazzName + ' name="cfclazz" class="cfclazz"/></td>'
                }
                if (studentsNameList[i].cfamount == null) {
                    str += '<td><input type="text" readonly unselectable="on" name="cfclazzamount" class="cfclazzamount"/></td>'
                } else {
                    str += '<td><input type="text" readonly unselectable="on" value=' + studentsNameList[i].cfamount + ' name="cfclazzamount" class="cfclazzamount"/></td>'
                }
                //规费
                var guigei = 0;
                $.ajax({
                    url: '<%=path%>/DrivingSys/selGuiFei',
                    type: "post",
                    async: false,
                    data: {'xzlx': studentsNameList[i].cfslzjcxdh},
                    dataType: "json",
                    success: function (json) {
                        guigei = json;
                    },
                    error: function () {
                        alert('Error');
                    }
                })
                if (studentsNameList[i].cfreceived == '0') {
                    str += '<td><input type="text" readonly unselectable="on" value="0" name="cfyishou" class="cfyishou"/></td>'
                    str += '<td><input type="text" readonly unselectable="on" value=' + studentsNameList[i].cfamount + ' name="cfysje" class="cfysje"/></td>'
                    str += '<td><input type="text" readonly unselectable="on" value=' + guigei + ' name="cfguifei" class="cfguifei" class="cfguifei"/></td>'
                    var pxf = ((studentsNameList[i].cfamount) * 1) - (guigei * 1)
                    jsgf = (jsgf * 1) + (guigei * 1)
                    //保留2位小数点
                    jsgf = decimal(jsgf, 2);
                    str += '<td><input type="text" readonly unselectable="on" value=' + pxf + ' name="cfpxf" class="cfpxf"/></td>'
                } else {
                    str += '<td><input type="text" readonly unselectable="on" value=' + studentsNameList[i].cfreceived + ' name="cfyishou" class="cfyishou"/></td>'
                    var ysje = (studentsNameList[i].cfamount - studentsNameList[i].cfreceived)
                    //保留2位小数点
                    ysje = decimal(ysje, 2);
                    str += '<td><input type="text" readonly unselectable="on" value=' + ysje + ' name="cfysje" class="cfysje"/></td>'
                    str += '<td><input type="text"  value="0" onblur="guifei($(this))" name="cfguifei" class="cfguifei"/></td>'
                    str += '<td><input type="text" readonly unselectable="on" value=' + ysje + ' name="cfpxf" class="cfpxf"/></td>'
                }
                str += '<td><input type="text" name="cfcash" onblur="cfcash2($(this))" class="cfcash"/><input type="hidden" value="0"/></td>'
                str += '<td><input type="text" name="cfcard" onblur="cfcard2($(this))" class="cfcard"/><input type="hidden" value="0"/></td>'
                str += '<td><input type="text" name="cfguazhang" onblur="cfguazhang2($(this))" class="cfguazhang"/><input type="hidden" value="0"/></td>'
                str += '<td><input type="text" name="cfyhzz" onblur="cfyhzz2($(this))" class="cfyhzz"/><input type="hidden" value="0"/></td>'
                str += '<td><input type="text" readonly unselectable="on" value="0" name="cfshje" class="cfshje" /></td>'
                if (studentsNameList[i].cffavorable == null) {
                    str += '<td><input type="text" name="cfyhje"  onblur="cfyhje2($(this))" class="cfyhje"><input type="hidden" value="0"/></td>'
                } else {
                    str += '<td><input type="text" name="cfyhje"  onblur="cfyhje2($(this))" class="cfyhje" value=' + studentsNameList[i].cffavorable + '><input type="hidden" value="' + studentsNameList[i].cffavorable + '"/></td>'
                }
                str += '<td><input type="text" name="cfyhj" onblur="cfyhj2($(this))" class="cfyhj"/><input type="hidden" value="0"/></td>'
                qfjine = (qfjine * 1) + ((studentsNameList[i].cfarrearage) * 1);
                //保留2位小数点
                qfjine = decimal(qfjine, 2);
                str += '<td><input type="text" name="cfqfje" readonly unselectable="on" class="cfqfje" value=' + studentsNameList[i].cfarrearage + '></td>'
                str += '<td><input type="text" name="cfremark" class="cfremark"/></td>'
                str += '</tr>'
            }
            /*//计算规费
			var gfzj = $(".gf").next().val();
			if(gfzj == 0){
				 $(".gf").val(jsgf)
				 $(".gf").next().val(jsgf)
			}else{
				var result = (gfzj*1)+(jsgf*1);
				//保留2位小数点
				result = decimal(result,2);
				$(".gf").val(result)
				$(".gf").next().val(result)
			}
			//计算欠费金额
			var jq = $("#cfqfje").next().val();
			if(jq == 0){
				$("#cfqfje").val(qfjine)
				$("#cfqfje").next().val(qfjine)
			}else{
				var result = (jq*1)+(qfjine*1);
				//保留2位小数点
				result = decimal(result,2);
				$("#cfqfje").val(result)
				$("#cfqfje").next().val(result)
			}
			$("#table2").show()
			$("#table1").append(str)
			//计算优惠金额
			var youhui = 0;
			$(".cfyhje").each(function(i){
				var s = $(this).val();
				youhui = youhui*1 + s*1
				//保留2位小数点
				youhui = decimal(youhui,2);
			})
         $("#cfyhje").val(youhui);*/
            $("#table2").show()
            $("#table1").append(str)
            allMoney();
            $('#modal-overlay').css('visibility', 'hidden')
            $('.modal-data').css('visibility', 'hidden')
        } else {
            //之前规费
            var sgeifei = $('#xy' + fseq + '').find(".cfguifei").val();
            //之前欠费金额
            var cfqfje = $('#xy' + fseq + '').find(".cfqfje").val();
            //规费
            var guigei = 0;
            $.ajax({
                url: '<%=path%>/DrivingSys/selGuiFei',
                type: "post",
                async: false,
                data: {'xzlx': studentsNameList.cfslzjcxdh},
                dataType: "json",
                success: function (json) {
                    guigei = json;
                },
                error: function () {
                    alert('Error');
                }
            })

            if (studentsNameList.fnumber == null) {
                $('#xy' + fseq + '').find(".cfstudentno").val("")
                $('#xy' + fseq + '').find(".cfstudentno").next().val(studentsNameList.fid)
            } else {
                $('#xy' + fseq + '').find(".cfstudentno").val(studentsNameList.fnumber)
                $('#xy' + fseq + '').find(".cfstudentno").next().val(studentsNameList.fid)
            }
            if (studentsNameList.fnameL2 == null) {
                $('#xy' + fseq + '').find(".studentName").val("")
            } else {
                $('#xy' + fseq + '').find(".studentName").val(studentsNameList.fnameL2)

            }
            if (studentsNameList.cfsex == '1') {
                $('#xy' + fseq + '').find(".cfsex").val("男")
                $('#xy' + fseq + '').find(".cfsex").next().val("1")
            } else {
                $('#xy' + fseq + '').find(".cfsex").val("女")
                $('#xy' + fseq + '').find(".cfsex").next().val("2")
            }
            if (studentsNameList.cfidcardno == null) {
                $('#xy' + fseq + '').find(".cfidcardno").val("")
            } else {
                $('#xy' + fseq + '').find(".cfidcardno").val(studentsNameList.cfidcardno)
            }
            if (studentsNameList.cflinkaddress == null) {
                $('#xy' + fseq + '').find(".cfidcardaddress").val("")
            } else {
                $('#xy' + fseq + '').find(".cfidcardaddress").val(studentsNameList.cflinkaddress)
            }
            if (studentsNameList.cftjrName == null) {
                $('#xy' + fseq + '').find(".cftjr").val("")
            } else {
                $('#xy' + fseq + '').find(".cftjr").val(studentsNameList.cftjrName)
            }
            if (studentsNameList.cfclazzName == null) {
                $('#xy' + fseq + '').find(".cfclazz").val("")
            } else {
                $('#xy' + fseq + '').find(".cfclazz").val(studentsNameList.cfclazzName)
            }
            if (studentsNameList.cfamount == null) {
                $('#xy' + fseq + '').find(".cfclazzamount").val("")
            } else {
                $('#xy' + fseq + '').find(".cfclazzamount").val(studentsNameList.cfamount)
            }
            if (studentsNameList.cfreceived == '0') {
                $('#xy' + fseq + '').find(".cfyishou").val("0")
                $('#xy' + fseq + '').find(".cfysje").val(studentsNameList.cfamount)
                $('#xy' + fseq + '').find(".cfguifei").val(guigei)
                var pxf = (studentsNameList.cfarrearage - guigei)
                $('#xy' + fseq + '').find(".cfpxf").val(pxf)
            } else {
                $('#xy' + fseq + '').find(".cfyishou").val(studentsNameList.cfreceived)
                var ysje = (studentsNameList.cfamount - studentsNameList.cfreceived)
                $('#xy' + fseq + '').find(".cfysje").val(ysje)
                guigei = 0;
                $('#xy' + fseq + '').find(".cfguifei").val(guigei)
                $('#xy' + fseq + '').find(".cfpxf").val(studentsNameList.cfreceived)
            }
            //清空之前缴费金额
            $('#xy' + fseq + '').find(".cfcash").val("");//现金
            $('#xy' + fseq + '').find(".cfcash").next().val("");
            $('#xy' + fseq + '').find(".cfcard").val("");//刷卡
            $('#xy' + fseq + '').find(".cfcard").next().val("");
            $('#xy' + fseq + '').find(".cfguazhang").val("");//挂账
            $('#xy' + fseq + '').find(".cfguazhang").next().val("");
            $('#xy' + fseq + '').find(".cfyhzz").val("");//银行转账
            $('#xy' + fseq + '').find(".cfyhzz").next().val("");
            $('#xy' + fseq + '').find(".cfshje").val("0");//实收金额
            $('#xy' + fseq + '').find(".cfyhje").val(studentsNameList.cffavorable);//优惠金额
            $('#xy' + fseq + '').find(".cfyhje").next().val(studentsNameList.cffavorable);
            $('#xy' + fseq + '').find(".cfyhj").val("");//优惠券
            $('#xy' + fseq + '').find(".cfyhj").next().val("");
            $('#xy' + fseq + '').find(".cfqfje").val(studentsNameList.cfarrearage);//欠费金额
            $('#xy' + fseq + '').find(".cfqfje").next().val(studentsNameList.cfarrearage);
            allMoney();
            $(".stu").val("");
            $('#modal-overlay').css('visibility', 'hidden')
            $('.modal-data').css('visibility', 'hidden')
            /*var onefjine = (qfjine*1)+((studentsNameList.cfarrearage)*1);
			//保留2位小数点
			onefjine = decimal(onefjine,2);
			$('#xy'+fseq+'').find(".cfqfje").val(onefjine)
		    $('#modal-overlay').css('visibility', 'hidden')
		    $('.modal-data').css('visibility', 'hidden')
			//利用之前的规费和现在的规费进行判断
		    if(guigei == sgeifei){

		    }else{
		         var gf = $(".gf").val()
		         var gfResulet = (gf*1) - (sgeifei*1) + (guigei*1)
		         //保留2位小数点
				 gfResulet = decimal(gfResulet,2);
		         $(".gf").val(gfResulet)
		   }
		   //利用之前的欠费金额和现在的欠费金额进行判断
		   if(cfqfje == onefjine){

		    }else{
		        var jine = $("#cfqfje").val()
		        var resulet = (jine*1) - (cfqfje*1) + (onefjine*1);
		        //保留2位小数点
				resulet = decimal(resulet,2);
		        $("#cfqfje").val(resulet)
		     }
         $(".stu").val("");*/
        }
    }

    //现金计算
    function cfcash2(_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if (_this.val() == '-') {
            _this.val("")
        }
        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }
        //现金
        var money = _this.val()
        if (money == '') {
            money = 0;
        }
        //存放之前的值
        var zq = _this.next().val();
        _this.next().val(money);
        //实收金额
        var ssje = _this.parent().next().next().next().next().find(".cfshje").val();


        //计算实收金额
        var jine = (ssje * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        jine = decimal(jine, 2);
        _this.parent().next().next().next().next().find(".cfshje").val(jine);
        //欠费金额
        var jfje = _this.parent().next().next().next().next().next().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        mon = decimal(mon, 2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().next().next().next().next().next().find(".cfqfje").val(mon);

        //总额
        var ze = $("#cfcash").val();
        //计算总额
        var jine = (ze * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        jine = decimal(jine, 2);
        $("#cfcash").val(jine);

        //实收金额
        var ss = $("#cfshje").val();
        //计算实收总额
        var ssResult = (ss * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        ssResult = decimal(ssResult, 2);
        $("#cfshje").val(ssResult);

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        ssResult = decimal(ssResult, 2);
        $("#cfqfje").val(ssResult);
        $(".cfyishou").val($(".cfshje").val())

    }

    //挂账计算
    function cfguazhang2(_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if (_this.val() == '-') {
            _this.val("")
        }
        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }
        //现金
        var money = _this.val()
        if (money == '') {
            money = 0;
        }
        //存放之前的值
        var zq = _this.next().val();
        _this.next().val(money);
        //实收金额
        var ssje = _this.parent().next().next().find(".cfshje").val();
        //计算实收金额
        var jine = (ssje * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        jine = decimal(jine, 2);
        _this.parent().next().next().find(".cfshje").val(jine)
        //欠费金额
        var jfje = _this.parent().next().next().next().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        mon = decimal(mon, 2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().next().next().next().find(".cfqfje").val(mon);

        //总额
        var ze = $("#cfguazhang").val();
        //计算总额
        var jine = (ze * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        jine = decimal(jine, 2);
        $("#cfguazhang").val(jine);

        //实收金额
        var ss = $("#cfshje").val();
        //计算实收总额
        var ssResult = (ss * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        ssResult = decimal(ssResult, 2);
        $("#cfshje").val(ssResult);

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj * 1) + (zq * 1) - (money * 1);
        ssResult = decimal(ssResult, 2);
        $("#cfqfje").val(ssResult);
        $(".cfyishou").val($(".cfshje").val())

    }

    //银行转账计算
    function cfyhzz2(_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if (_this.val() == '-') {
            _this.val("")
        }
        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }
        //现金
        var money = _this.val()
        if (money == '') {
            money = 0;
        }
        //存放之前的值
        var zq = _this.next().val();
        _this.next().val(money);
        //实收金额
        var ssje = _this.parent().next().find(".cfshje").val();
        //计算实收金额
        var jine = (ssje * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        jine = decimal(jine, 2);
        _this.parent().next().find(".cfshje").val(jine);
        //欠费金额
        var jfje = _this.parent().next().next().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        mon = decimal(mon, 2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().next().next().find(".cfqfje").val(mon);
        //总额
        var ze = $("#cfyhzz").val();
        //计算总额
        var jine = (ze * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        jine = decimal(jine, 2);
        $("#cfyhzz").val(jine);

        //实收金额
        var ss = $("#cfshje").val();
        //计算实收总额
        var ssResult = (ss * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        ssResult = decimal(ssResult, 2);
        $("#cfshje").val(ssResult);

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        ssResult = decimal(ssResult, 2);
        $("#cfqfje").val(ssResult);
        $(".cfyishou").val($(".cfshje").val())

    }


    //刷卡计算
    function cfcard2(_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if (_this.val() == '-') {
            _this.val("")
        }
        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }
        //现金
        var money = _this.val()
        if (money == '') {
            money = 0;
        }
        //存放之前的值
        var zq = _this.next().val();
        _this.next().val(money);
        //实收金额
        var ssje = _this.parent().next().next().next().find(".cfshje").val();
        //计算实收金额
        var jine = (ssje * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        jine = decimal(jine, 2);
        _this.parent().next().next().next().find(".cfshje").val(jine);
        //欠费金额
        var jfje = _this.parent().next().next().next().next().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        mon = decimal(mon, 2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().next().next().next().next().find(".cfqfje").val(mon);

        //总额
        var ze = $("#cfcard").val();
        //计算总额
        var jine = (ze * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        jine = decimal(jine, 2);
        $("#cfcard").val(jine);

        //实收金额
        var ss = $("#cfshje").val();
        //计算实收总额
        var ssResult = (ss * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        ssResult = decimal(ssResult, 2);
        $("#cfshje").val(ssResult);

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        ssResult = decimal(ssResult, 2);
        $("#cfqfje").val(ssResult);
        $(".cfyishou").val($(".cfshje").val())

    }

    //优惠金额计算
    function cfyhje2(_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if (_this.val() == '-') {
            _this.val("")
        }
        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }
        //现金
        var money = _this.val()
        if (money == '') {
            money = 0;
        }
        //存放之前的值
        var zq = _this.next().val();
        _this.next().val(money);
        //欠费金额
        var jfje = _this.parent().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        mon = decimal(mon, 2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().find(".cfqfje").val(mon);
        //总额
        var ze = $("#cfyhje").val();
        //计算总额
        var jine = (ze * 1) - (zq * 1) + (money * 1);
        //保留2位小数点
        jine = decimal(jine, 2);
        $("#cfyhje").val(jine);

        //实收金额
        var ss = $("#cfshje").val();

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        ssResult = decimal(ssResult, 2);
        $("#cfqfje").val(ssResult);
        $(".cfyishou").val($(".cfshje").val())

    }

    //优惠券计算
    function cfyhj2(_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if (_this.val() == '-') {
            _this.val("")
        }
        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }
        //现金
        var money = _this.val()
        if (money == '') {
            money = 0;
        }
        //存放之前的值
        var zq = _this.next().val();
        _this.next().val(money);
        //欠费金额
        var jfje = _this.parent().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        mon = decimal(mon, 2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().find(".cfqfje").val(mon);
        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj * 1) + (zq * 1) - (money * 1);
        //保留2位小数点
        ssResult = decimal(ssResult, 2);
        $("#cfqfje").val(ssResult);
        $(".cfyishou").val($(".cfshje").val())

    }

    //规费
    function guifei(_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if (_this.val() == '-') {
            _this.val("")
        }
        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }
        let count = 0;
        $('.cfguifei').each(function (e) {
            count+=$(this).val()*1
        })

        $(".gf").val(count);
    }

    //点击单个学员
    function selSrtdent(_this) {
        //获取当前对象序列
        var ss = _this.parent().prev().prev().find(".fseq").val();
        //存放获取当前学员id
        $("#stuId").val(_this.parent().prev().find("input:hidden").val())
        $(".stu").val(ss);
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data').css('visibility', 'visible')
        $('.xysj input:checkbox').removeAttr('checked');
        $('#index').val(1)
        $('.page').show();
    }


    //num是要处理的数字  v为要保留的小数位数
    function decimal(num, v) {
        var vv = Math.pow(10, v);
        return Math.round(num * vv) / vv;
    }

    window.onload = function () {
        allMoney();
    }

    function allMoney() {
        //计算规费
        var gf = 0;
        $(".cfguifei").each(function (i) {
            var s = $(this).val();
            gf = (gf * 1) + (s * 1);
            gf = decimal(gf, 2);
        })
        $(".gf").val(gf)
        //计算现金
        var cfcash = 0;
        $(".cfcash").each(function (i) {
            var s = $(this).val();
            cfcash = (cfcash * 1) + (s * 1);
            cfcash = decimal(cfcash, 2);
        })
        $("#cfcash").val(cfcash)
        //计算刷卡
        var cfcard = 0;
        $(".cfcard").each(function (i) {
            var s = $(this).val();
            cfcard = (cfcard * 1) + (s * 1);
            cfcard = decimal(cfcard, 2);
        })
        $("#cfcard").val(cfcard)
        //计算挂账
        var cfguazhang = 0;
        $(".cfguazhang").each(function (i) {
            var s = $(this).val();
            cfguazhang = (cfguazhang * 1) + (s * 1);
            cfguazhang = decimal(cfguazhang, 2);
        })
        $("#cfguazhang").val(cfguazhang)
        //计算银行转账
        var cfyhzz = 0;
        $(".cfyhzz").each(function (i) {
            var s = $(this).val();
            cfyhzz = (cfyhzz * 1) + (s * 1);
            cfyhzz = decimal(cfyhzz, 2);
        })
        $("#cfyhzz").val(cfyhzz)
        //计算实收金额
        var cfshje = 0;
        $(".cfshje").each(function (i) {
            var s = $(this).val();
            cfshje = (cfshje * 1) + (s * 1);
            cfshje = decimal(cfshje, 2);
        })
        $("#cfshje").val(cfshje)
        //计算优惠金额
        var cfyhje = 0;
        $(".cfyhje").each(function (i) {
            var s = $(this).val();
            cfyhje = (cfyhje * 1) + (s * 1);
            cfyhje = decimal(cfyhje, 2);
        })
        $("#cfyhje").val(cfyhje)
        //计算欠费金额
        var cfqfje = 0;
        $(".cfqfje").each(function (i) {
            var s = $(this).val();
            cfqfje = (cfqfje * 1) + (s * 1);
            cfqfje = decimal(cfqfje, 2);
        })
        $("#cfqfje").val(cfqfje)
        $("#cfqfje").next().val(cfqfje)
    }

    //审核,反审核弹框
    $("#sh,#fsh").click(function () {
        var type = $(this).next().val();
        $("#type").val(type)
        if (type == 1) {
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data9').css('visibility', 'visible')
            $('li input:radio:first').attr('checked', 'checked');
        }
        else if (type == 2) {
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data10').css('visibility', 'visible')
        }
    })
    //审核,反审核
    $("#auditsubmit,#againstAuditsubmit").click(function () {
        //防止重复提交
        $(this).attr("disabled", "disabled")
        var state = $('li input[type="radio"]:checked ').val();//同意/不同意
        var fid = $(".fid").val();//fid
        var fnumber = $("input[name='fnumber']").val();//编码
        var type = $("#type").val();
        var message;
        if (type == '1') {
            message = $("#auditcomment").val();
        } else {
            message = $("#againstAuditcomment").val();
        }
        var studentName = new Array();
        var studentId = new Array();
        var cfstudentno = new Array();
        $(".studentName").each(function (i) {
            studentName[i] = $(this).val();
            studentId[i] = $(this).next().val();
            cfstudentno[i] = $(this).parent().prev().find(".cfstudentno").val();
        })

        $.ajax({
            url: '<%=path%>/DrivingSys/auditTrainCharge',
            type: "post",
            data: {
                'fid': fid,
                'type': type,
                'fnumber': fnumber,
                'message': message,
                'state': state,
                'studentName': studentName,
                'studentId': studentId,
                'cfstudentno': cfstudentno
            },
            dataType: "json",
            success: function (json) {
                //var url = '/queryTrainCharge/look.action';
                var url = 'selectTrainChargeByFid?fid='+fid;
                if (type == '1') {
                    if (json == '1') {
                        showAlert('审核成功,并且此流程已结束', url)
                    } else if (json == '2') {
                        showAlert('审核成功', url)
                    } else {
                        showAlert('审核失败', url)
                    }
                } else {
                    if (json == '1') {
                        showAlert('反审核成功', url)
                    } else if (json == '2') {
                        showAlert('没有找到任务', url)
                    } else if (json == '0') {
                        showAlert('找不到流程节点', url)
                    }
                }
            },
            error: function () {
                $("#againstAuditsubmit,#auditsubmit").attr("disabled", false)//去除input元素的disabled属性
                alert('错误');
            }
        })
    })

    //提交
    $("#submit").click(function () {
        $.messager.confirm('提示', '是否提交,提交后不会改变修改后的值', function (r) {
            if (r) {
                //var url = '/queryTrainCharge/look.action';
                var fid = $(".fid").val();
                var url = 'selectTrainChargeByFid?fid='+fid;
                var fnumber = $("input[name='fnumber']").val();
                var auditState = $("#auditState").val();
                var studentName = new Array();
                var studentId = new Array();
                var cfstudentno = new Array();
                $(".studentName").each(function (i) {
                    studentName[i] = $(this).val();
                    studentId[i] = $(this).next().val();
                    cfstudentno[i] = $(this).parent().prev().find(".cfstudentno").val();
                })
                $.ajax({
                    url: '<%=path%>/DrivingSys/submitTrainCharge',
                    type: "post",
                    data: {
                        'fid': fid,
                        'fnumber': fnumber,
                        'auditState': auditState,
                        'studentName': studentName,
                        'studentId': studentId,
                        'cfstudentno': cfstudentno
                    },
                    dataType: "json",
                    success: function (json) {
                        if (json == 1) {
                            showAlert('提交成功', url)
                        } else {
                            showAlert('提交失败', url)
                        }
                    },
                    error: function () {
                        alert("错误")
                    }
                })
            }
        })
    })

    //提交并审核
    $("#submit_audit").click(function () {
        $.messager.confirm('提示', '是否直接审核,审核将会跳过提交', function (r) {
            if (r) {
                //var url = '/queryTrainCharge/look.action';
                var fid = $(".fid").val();
                var url = 'selectTrainChargeByFid?fid='+fid;
                var fnumber = $("input[name='fnumber']").val();
                var auditState = $("#auditState").val();
                var studentName = new Array();
                var studentId = new Array();
                var cfstudentno = new Array();
                $(".studentName").each(function (i) {
                    studentName[i] = $(this).val();
                    studentId[i] = $(this).next().val();
                    cfstudentno[i] = $(this).parent().prev().find(".cfstudentno").val();
                })
                $.ajax({
                    url: '<%=path%>/DrivingSys/submitTrainCharge',
                    type: "post",
                    data: {
                        'fid': fid,
                        'fnumber': fnumber,
                        'auditState': auditState,
                        'studentName': studentName,
                        'studentId': studentId,
                        'cfstudentno': cfstudentno
                    },
                    dataType: "json",
                    success: function (json) {
                        if (json == 1) {
                            if (json == 1) {
                                $(this).attr("disabled", "disabled")
                                var state = 1;//同意/不同意
                                var fid = $(".fid").val();//fid
                                var fnumber = $("input[name='fnumber']").val();//编码
                                var type = 1;
                                var message;
                                if (type == '1') {
                                    message = $("#auditcomment").val();
                                } else {
                                    message = $("#againstAuditcomment").val();
                                }
                                var studentName = new Array();
                                var studentId = new Array();
                                var cfstudentno = new Array();
                                $(".studentName").each(function (i) {
                                    studentName[i] = $(this).val();
                                    studentId[i] = $(this).next().val();
                                    cfstudentno[i] = $(this).parent().prev().find(".cfstudentno").val();
                                })

                                $.ajax({
                                    url: '<%=path%>/DrivingSys/auditTrainCharge',
                                    type: "post",
                                    data: {
                                        'fid': fid,
                                        'type': type,
                                        'fnumber': fnumber,
                                        'message': message,
                                        'state': state,
                                        'studentName': studentName,
                                        'studentId': studentId,
                                        'cfstudentno': cfstudentno
                                    },
                                    dataType: "json",
                                    success: function (json) {
                                        //var url = '/queryTrainCharge/look.action';
                                        var url = 'selectTrainChargeByFid?fid='+fid;
                                        if (type == '1') {
                                            if (json == '1') {
                                                showAlert('审核成功,并且此流程已结束', url)
                                            } else if (json == '2') {
                                                showAlert('审核成功', url)
                                            } else {
                                                showAlert('审核失败', url)
                                            }
                                        } else {
                                            if (json == '1') {
                                                showAlert('反审核成功', url)
                                            } else if (json == '2') {
                                                showAlert('没有找到任务', url)
                                            } else if (json == '0') {
                                                showAlert('找不到流程节点', url)
                                            }
                                        }
                                    },
                                    error: function () {
                                        $("#againstAuditsubmit,#auditsubmit").attr("disabled", false)//去除input元素的disabled属性
                                        alert('错误');
                                    }
                                })
                            } else {
                                showAlert('提交失败', url)
                            }
                        } else {
                            showAlert('提交失败', url)
                        }
                    },
                    error: function () {
                        alert("错误")
                    }
                })
            }
        })
    })

    //验证单据下是否有数据
    function verify() {
        var s = 0;
        $("input[name='cfstudentid']").each(function () {
            if ($(this).val() == '' || $(this).val() == null) {

            } else {
                s = 1;
                return false;
            }

        })
        var ywrq = $("#ywrq").val();
        if (ywrq == null || ywrq == '') {
            alert("业务日期不能为空");
            return false;
        }
        if (s == 0) {
            alert("请至少选择一条数据");
            return false;
        }
        $("input[type='submit']").attr("disabled", "disabled");
    }

    //只读的属性不被修改
    $('input[readonly]').on('focus', function () {
        $(this).trigger('blur');
    });

    //-----------------------------------------关于打印-----------------------------------


    $('.trainChargeTable').find('tr:lt(2)').find('td').css('border', 'none');
    $('.trainChargeTable').find('tr').find('td:eq(0)').css('color', 'black');


    //给大写单元格赋值
    $('.turnCapital').each(function () {
        var lowCase = $(this).prev().prev().text();
        $(this).text(Arabia_to_Chinese(lowCase));
    })


    //阿拉伯金额转中文大写
    function Arabia_to_Chinese(Num) {
        if (Num == "0") {
            return "零元整";
        }
        for (i = Num.length - 1; i >= 0; i--) {
            Num = Num.replace(",", "")//替换tomoney()中的“,”
            Num = Num.replace(" ", "")//替换tomoney()中的空格
        }
        Num = Num.replace("￥", "")//替换掉可能出现的￥字符
        if (isNaN(Num)) { //验证输入的字符是否为数字
            //alert("请检查小写金额是否正确");
            return;
        }
        //---字符处理完毕，开始转换，转换采用前后两部分分别转换---//
        part = String(Num).split(".");
        newchar = "";
        //小数点前进行转化
        for (i = part[0].length - 1; i >= 0; i--) {
            if (part[0].length > 10) {
                alert("位数过大，无法计算");
                return "";
            } //若数量超过拾亿单位，提示
            tmpnewchar = ""
            perchar = part[0].charAt(i);
            switch (perchar) {
                case "0":
                    tmpnewchar = "零" + tmpnewchar;
                    break;
                case "1":
                    tmpnewchar = "壹" + tmpnewchar;
                    break;
                case "2":
                    tmpnewchar = "贰" + tmpnewchar;
                    break;
                case "3":
                    tmpnewchar = "叁" + tmpnewchar;
                    break;
                case "4":
                    tmpnewchar = "肆" + tmpnewchar;
                    break;
                case "5":
                    tmpnewchar = "伍" + tmpnewchar;
                    break;
                case "6":
                    tmpnewchar = "陆" + tmpnewchar;
                    break;
                case "7":
                    tmpnewchar = "柒" + tmpnewchar;
                    break;
                case "8":
                    tmpnewchar = "捌" + tmpnewchar;
                    break;
                case "9":
                    tmpnewchar = "玖" + tmpnewchar;
                    break;
            }
            switch (part[0].length - i - 1) {
                case 0:
                    tmpnewchar = tmpnewchar + "元";
                    break;
                case 1:
                    if (perchar != 0) tmpnewchar = tmpnewchar + "拾";
                    break;
                case 2:
                    if (perchar != 0) tmpnewchar = tmpnewchar + "佰";
                    break;
                case 3:
                    if (perchar != 0) tmpnewchar = tmpnewchar + "仟";
                    break;
                case 4:
                    tmpnewchar = tmpnewchar + "万";
                    break;
                case 5:
                    if (perchar != 0) tmpnewchar = tmpnewchar + "拾";
                    break;
                case 6:
                    if (perchar != 0) tmpnewchar = tmpnewchar + "佰";
                    break;
                case 7:
                    if (perchar != 0) tmpnewchar = tmpnewchar + "仟";
                    break;
                case 8:
                    tmpnewchar = tmpnewchar + "亿";
                    break;
                case 9:
                    tmpnewchar = tmpnewchar + "拾";
                    break;
            }
            newchar = tmpnewchar + newchar;
        }
        //小数点之后进行转化
        if (Num.indexOf(".") != -1) {
            if (part[1].length > 2) {
                alert("小数点之后只能保留两位,系统将自动截段");
                part[1] = part[1].substr(0, 2)
            }
            for (i = 0; i < part[1].length; i++) {
                tmpnewchar = ""
                perchar = part[1].charAt(i)
                switch (perchar) {
                    case "0":
                        tmpnewchar = "零" + tmpnewchar;
                        break;
                    case "1":
                        tmpnewchar = "壹" + tmpnewchar;
                        break;
                    case "2":
                        tmpnewchar = "贰" + tmpnewchar;
                        break;
                    case "3":
                        tmpnewchar = "叁" + tmpnewchar;
                        break;
                    case "4":
                        tmpnewchar = "肆" + tmpnewchar;
                        break;
                    case "5":
                        tmpnewchar = "伍" + tmpnewchar;
                        break;
                    case "6":
                        tmpnewchar = "陆" + tmpnewchar;
                        break;
                    case "7":
                        tmpnewchar = "柒" + tmpnewchar;
                        break;
                    case "8":
                        tmpnewchar = "捌" + tmpnewchar;
                        break;
                    case "9":
                        tmpnewchar = "玖" + tmpnewchar;
                        break;
                }
                if (i == 0) tmpnewchar = tmpnewchar + "角";
                if (i == 1) tmpnewchar = tmpnewchar + "分";
                newchar = newchar + tmpnewchar;
            }
        }
        //替换所有无用汉字
        while (newchar.search("零零") != -1)
            newchar = newchar.replace("零零", "零");
        newchar = newchar.replace("零亿", "亿");
        newchar = newchar.replace("亿万", "亿");
        newchar = newchar.replace("零万", "万");
        newchar = newchar.replace("零元", "元");
        newchar = newchar.replace("零角", "");
        newchar = newchar.replace("零分", "");

        if (newchar.charAt(newchar.length - 1) == "元" || newchar.charAt(newchar.length - 1) == "角")
            newchar = newchar + "整"
        //  document.write(newchar);
        return newchar;

    }


    /*.modal-data-trainChargePrint*/
    //jquery打印方法
    function test() {
        /*var aa = $('.trainChargeTable').find('tr:eq(0)').find('td:eq(2)').text();
    alert(aa);
    return;
    debugger;*/
        if ($('#printState').val() == 0) {
            $('#edit-print-id-2').css('display','block');
            /*包含規費*/
            $("#edit-print-id-2").print({
                //是否读取页面的样式
                globalStyles: true,
                //添加与attrbute media=打印的链接。
                mediaPrint: false,
                //在隐藏的iframe中打印。
                iframe: false,
                //不打印 的内容（选择器）
                noPrintSelector: ".avoid-this",
                //Add this at top
                prepend: "Hello World!!!<br/>",
                //Add this on bottom
                append: "<br/>Buh Bye!",
                //Log to console when printing is done via a deffered callback
                deferred: $.Deferred().done(function () {
                    console.log('Printing done', arguments);
                })
            });
            $('#edit-print-id-2').css('display','none');
        }
        else {
            $('#edit-print-id-1').css('display','block');
            $("#edit-print-id-1").print({
                //是否读取页面的样式
                globalStyles: true,
                //添加与attrbute media=打印的链接。
                mediaPrint: false,
                //在隐藏的iframe中打印。
                iframe: false,
                //不打印 的内容（选择器）
                noPrintSelector: ".avoid-this",
                //Add this at top
                prepend: "Hello World!!!<br/>",
                //Add this on bottom
                append: "<br/>Buh Bye!",
                //Log to console when printing is done via a deffered callback
                deferred: $.Deferred().done(function () {
                    console.log('Printing done', arguments);
                })
            });
            $('#edit-print-id-1').css('display','none');
        }
        //$.print("#print-table-id");
    }


</script>
</html>